package cn.itsource.org.controller;

import cn.itsource.basic.util.AjaxResult;
import cn.itsource.org.domain.Employee;
import cn.itsource.org.domain.LoginInfo;
import cn.itsource.org.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @Autowired
    private ILoginService loginService;

    @PostMapping("/system/login")
    public AjaxResult login(@RequestBody Employee employee) {
        LoginInfo result = loginService.systemLogin(employee);
        return AjaxResult.ok(result);
    }
}
